package de.hs_heilbronn;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class Book {

	private String isbn = "123 - 0123456789";
	private String autor = "Max Mustermann";
	private String titel = "Das Buch der Beispiele";
	private int matrikel;
	
	public String create () {
		Database db = new Database();
		db.connectUpdate("INSERT INTO buch (isbn, titel, autor) VALUES ('" + isbn + "','" + titel + "','" + autor + "');");
		return "success";
	}
	
	public String getIsbn() {
		return isbn;
	}
	public void setIsbn(String isbn) {
		this.isbn = isbn;
	}
	public String getAutor() {
		return autor;
	}
	public void setAutor(String autor) {
		this.autor = autor;
	}
	public String getTitel() {
		return titel;
	}
	public void setTitel(String titel) {
		this.titel = titel;
	}
	public int getMatrikel() {
		return matrikel;
	}
	public void setMatrikel(int matrikel) {
		this.matrikel = matrikel;
	}
	
	
	
	
}
